from django.contrib import admin
from django.urls import path, re_path
from django.conf.urls import url
from . import views
from rest_framework.routers import DefaultRouter

urlpatterns = [
    url(r'login', views.loginView.as_view({"post": "login"})),
    url(r'changepassword', views.loginView.as_view({"patch": "change"})),
    url(r'user/$', views.usrGenView.as_view()),
    url(r'user/(?P<pk>\d+)/$', views.usrGenView.as_view()),
    url(r'equipment/$', views.eqGenView.as_view()),
    url(r'equipment/(?P<pk>\d+)/$', views.eqGenView.as_view()),
    url(r'eprunning/$', views.epRunGenView.as_view()),
    url(r'eprunning/(?P<pk>\d+)/$', views.epRunGenView.as_view()),
    url(r'repair/$', views.repairGenView.as_view()),
    url(r'repair/(?P<pk>\d+)/$', views.repairGenView.as_view()),
    url(r'scrap/$', views.scrapGenView.as_view()),
    url(r'scrap/(?P<pk>\d+)/$', views.scrapGenView.as_view()),
    url(r'util/$', views.components.as_view()),
    url(r'upload/$', views.fileUploadGenView.as_view()),
    url(r'userdetail/$', views.userDetailGenView.as_view()),
    url(r'download/$', views.downloadGenView.as_view()),
]

router = DefaultRouter()

# router.register(r'login', views.loginView.as_view({'post': 'login'}), basename='Login')


# router.register(r'equipment', views.equipmentModelViewSet, basename='Equipment')
# router.register(r'user', views.usrModelViewSet, basename='User')
# router.register(r'eprunning', views.epRunningModelViewSet, basename='epRunning')
# router.register(r'repair', views.repairModelViewSet, basename='repair')

urlpatterns += router.urls

